﻿KISSY.use("validation", function (S, Validation) {
    S.ready(function (S) {
        var All = S.all,
            form = All("#lg_frm"),
            VALID_EFFECT = "Simple",
            VALID_STYLE = "s_b",
            validator = new Validation(form[0], { warn: VALID_EFFECT, style: VALID_STYLE });


        validator.add("#lg_account",
        {
            required: [true, "Email is required."],
            email: [true, "Email format is incorrect"]
        });
        validator.add("#lg_pwd", { required: [true, "Password is required."] });
        form.on("submit", function (event) {
            var b = validator.isValid();
            if (b === false) {
                return false;
            }
        });
    });
});
